<template>
  <div class="receiveQueryContent">
    <div class="receiveQueryTitle">
      <!-- <div class="customerTitle">海川医药收货组{{ systemTime }}日报</div> -->
      <div class="customerTitle">海川医药收货组{{ dateTransfer }}日报</div>
      <!-- <div class="searchBtn">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="date"
        ></el-date-picker>
        <el-button type="success" @click="handleresearch">搜索</el-button>
      </div> -->
    </div>
    <div class="retable">
      <div class="customtr1">
        <div class="customText">客户/类别</div>
        <div class="delivery">
          <div class="deliveryTop">完成</div>
          <div class="deliveryBottom">
            <span>入库件数</span>
            <span>入库条目</span>
            <span>破损率</span>
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">未完成</div>
          <div class="deliveryBottom">
            <span>入库件数</span>
            <span>入库条目</span>
            <span>破损率</span>
          </div>
        </div>
        <div class="customText">备注(当日异常)</div>
        <div class="completeText">完成时间点</div>
      </div>
      <div class="customtr2">
        <div class="customText wyLayout">陕西海通</div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewcrkjsTotal"
              v-model="reform.htWcRkjs"
              size="medium"
            />
          </div>
        </div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewcrktmTotal"
            v-model="reform.htWcRktms"
            size="medium"
          />
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <div class="beakageRate">
              <el-input disabled v-model="reform.htWcPsl" size="medium" />
              <span>%</span>
            </div>
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewwcrkjsTotal"
              v-model="reform.htWwcRkjs"
              size="medium"
            />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewwcrktmTotal"
              v-model="reform.htWwcRktms"
              size="medium"
            />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <div class="beakageRate">
              <el-input disabled v-model="reform.htWwcPsl" size="medium" />
              <span>%</span>
            </div>
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input disabled v-model="reform.htBz" size="medium" />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop noborder">
            <el-time-picker
              disabled
              v-model="reform.htWcsjd"
              placeholder=""
              value-format="HH:mm"
              format="HH:mm"
            >
            </el-time-picker>
          </div>
        </div>
      </div>
      <div class="customtr2">
        <div class="customText wyLayout">陕西伟业</div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewcrkjsTotal"
              v-model="reform.wyWcRkjs"
              size="medium"
            />
          </div>
        </div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewcrktmTotal"
            v-model="reform.wyWcRktms"
            size="medium"
          />
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <div class="beakageRate">
              <el-input disabled v-model="reform.wyWcPsl" size="medium" />
              <span>%</span>
            </div>
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewwcrkjsTotal"
              v-model="reform.wyWwcRkjs"
              size="medium"
            />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input
              disabled
              @input="calculatewwcrktmTotal"
              v-model="reform.wyWwcRktms"
              size="medium"
            />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <div class="beakageRate">
              <el-input disabled v-model="reform.wyWwcPsl" size="medium" />
              <span>%</span>
            </div>
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop">
            <el-input disabled v-model="reform.wyBz" size="medium" />
          </div>
        </div>
        <div class="delivery">
          <div class="deliveryTop noborder">
            <el-time-picker
              disabled
              v-model="reform.wyWcsjd"
              placeholder=""
              value-format="HH:mm"
              format="HH:mm"
            >
            </el-time-picker>
          </div>
          <!-- <div class="deliveryBottom noborder">
          <el-time-picker
            v-model="form.wyTimeCWcsj"
            placeholder=""
            value-format="HH:mm"
            format="HH:mm"
          >
          </el-time-picker>
        </div> -->
        </div>
      </div>
      <div class="customtr3">
        <div class="customText wyLayout">其他货主</div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewcrkjsTotal"
            v-model="reform.qtWcRkjs"
            size="medium"
          />
        </div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewcrktmTotal"
            v-model="reform.qtWcRktms"
            size="medium"
          />
        </div>
        <div class="customText">
          <div class="beakageRate">
            <el-input disabled v-model="reform.qtWcPsl" size="medium" />
            <span>%</span>
          </div>
        </div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewwcrkjsTotal"
            v-model="reform.qtWwcRkjs"
            size="medium"
          />
        </div>
        <div class="customText">
          <el-input
            disabled
            @input="calculatewwcrktmTotal"
            v-model="reform.qtWwcRktms"
            size="medium"
          />
        </div>
        <div class="customText">
          <div class="beakageRate">
            <el-input disabled v-model="reform.qtWwcPsl" size="medium" />
            <span>%</span>
          </div>
        </div>
        <div class="customText">
          <el-input disabled v-model="reform.qtBz" size="medium" />
        </div>
        <div class="completeText">
          <el-time-picker
            disabled
            v-model="reform.qtWcsjd"
            placeholder=""
            value-format="HH:mm"
            format="HH:mm"
          >
          </el-time-picker>
        </div>
      </div>
      <div class="customtr4">
        <div class="customText wyLayout">合计</div>
        <!-- <div class="customText"></div> -->
        <div class="customText">
          <el-input disabled v-model="wcrkjsTotal" size="medium" />
        </div>
        <div class="customText">
          <el-input disabled v-model="wcrktmTotal" size="medium" />
        </div>
        <div class="customText">
          <el-input disabled size="medium" />
        </div>
        <div class="customText">
          <el-input disabled v-model="wwcrkjsTotal" size="medium" />
        </div>
        <div class="customText">
          <el-input disabled v-model="wwcrktmTotal" size="medium" />
        </div>
        <div class="customText">
          <el-input disabled size="medium" />
        </div>
        <div class="customText">
          <el-input disabled size="medium" />
        </div>
        <div class="completeText"></div>
      </div>
    </div>
  </div>
</template>

<script>
import { dailyscreenlistreceive } from "@/api/system/daily";
export default {
  props: {
    dateTransfer: {
      type: String,
    },
  },
  data() {
    return {
      // 日期范围
      dateRange: new Date().toISOString().split("T")[0],
      // 陕西海通零货条目数
      ids: null,
      systemTime: "",
      wcrkjsTotal: undefined,
      wcrktmTotal: undefined,
      wwcrkjsTotal: undefined,
      wwcrktmTotal: undefined,
      reform: {
        rbSj: new Date().toISOString().split("T")[0],
        // 海通
        htWcRkjs: null,
        htWcRktms: null,
        htWcPsl: null,
        htWwcRkjs: null,
        htWwcRktms: null,
        htWwcPsl: null,
        htBz: null,
        htWcsjd: null,
        // 伟业
        wyWcRkjs: null,
        wyWcRktms: null,
        wyWcPsl: null,
        wyWwcRkjs: null,
        wyWwcRktms: null,
        wyWwcPsl: null,
        wyBz: null,
        wyWcsjd: null,
        // 其他
        qtWcRkjs: null,
        qtWcRktms: null,
        qtWcPsl: null,
        qtWwcRkjs: null,
        qtWwcRktms: null,
        qtWwcPsl: null,
        qtWcsjd: null,
      },
    };
  },
  mounted() {
    // 创建一个 Date 对象
    const currentDate = new Date();
    // 获取当前年份
    const year = currentDate.getFullYear();
    // 获取当前月份（注意：月份是从 0 开始计数的，所以需要加 1）
    const month = currentDate.getMonth() + 1;
    // 获取当前日期
    const day = currentDate.getDate();
    // 打印年月日
    this.systemTime = `${year}年${month}月${day}日`;
      // this.handleresearch();
  },
  beforeDestroy() {},
  methods: {
    handleresearch() {
      dailyscreenlistreceive({ rbSj: this.dateTransfer }).then((res) => {
        if (res.data) {
          this.reform = res.data;
          this.wcrkjsTotal =
            Number(this.reform.htWcRkjs) +
            Number(this.reform.wyWcRkjs) +
            Number(this.reform.qtWcRkjs);
          this.wcrktmTotal =
            Number(this.reform.htWcRktms) +
            Number(this.reform.wyWcRktms) +
            Number(this.reform.qtWcRktms);
          this.wwcrkjsTotal =
            Number(this.reform.htWwcRkjs) +
            Number(this.reform.wyWwcRkjs) +
            Number(this.reform.qtWwcRkjs);
          this.wwcrktmTotal =
            Number(this.reform.htWwcRktms) +
            Number(this.reform.wyWwcRktms) +
            Number(this.reform.qtWwcRktms);
        }
      });
    },
    calculatewcrkjsTotal() {
      this.wcrkjsTotal =
        Number(this.reform.htWcRkjs) +
        Number(this.reform.wyWcRkjs) +
        Number(this.reform.qtWcRkjs);
    },
    calculatewcrktmTotal() {
      this.wcrktmTotal =
        Number(this.reform.htWcRktms) +
        Number(this.reform.wyWcRktms) +
        Number(this.reform.qtWcRktms);
    },
    calculatewwcrkjsTotal() {
      this.wwcrkjsTotal =
        Number(this.reform.htWwcRkjs) +
        Number(this.reform.wyWwcRkjs) +
        Number(this.reform.qtWwcRkjs);
    },
    calculatewwcrktmTotal() {
      this.wwcrktmTotal =
        Number(this.reform.htWwcRktms) +
        Number(this.reform.wyWwcRktms) +
        Number(this.reform.qtWwcRktms);
    },
  },
};
</script>

<style lang="scss" scoped>
.receiveQueryContent {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  ::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td {
    background-color: transparent;
  }

  ::v-deep .el-date-editor.el-input,
  .el-date-editor.el-input__inner {
    width: 100%;
  }
  .receiveQueryTitle {
    width: 100%;
    text-align: center;
    .customerTitle {
      width: 100%;
      font-size: 30px;
      font-weight: 700;
      margin: 10px 0 20px 0;
    }
    ::v-deep .el-button--success {
      height: 36px;
      margin-left: 30px;
    }
  }
  .retable {
    width: 80%;
    margin-top: 20px;
    ::v-deep .el-input__inner {
      height: 65px;
      line-height: 65px;
      border: none;
      text-align: center;
      color: #000000;
      width: 100%;
    }
  }
  .customtr1 {
    width: 100%;
    height: 140px;
    border: 1px solid #e7dfdf;
    background: #05a5ff;
    display: flex;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    justify-content: space-around;
    .customText {
      width: 11.1%;
      height: 140px;
      line-height: 140px;
      text-align: center;
      border-right: 1px solid #e7dfdf;
    }
    .completeText {
      width: 11.1%;
      height: 140px;
      line-height: 140px;
      text-align: center;
    }
    .delivery {
      width: 33.35%;
      display: flex;
      flex-direction: column;
      .deliveryTop {
        height: 50%;
        line-height: 70px;
        text-align: center;
        border-right: 1px solid #e7dfdf;
      }
      .deliveryBottom {
        height: 50%;
        display: flex;
        justify-content: space-around;
        border-top: 1px solid #e7dfdf;
        span {
          width: 34%;
          height: 100%;
          line-height: 70px;
          text-align: center;
          border-right: 1px solid #e7dfdf;
        }
      }
    }
  }
  .customtr2 {
    width: 100%;
    height: 70px;
    border-bottom: 1px solid #181616;
    border-left: 1px solid #181616;
    border-right: 1px solid #181616;
    // background: #00d9ff;
    display: flex;
    justify-content: space-around;
    .customText {
      width: 11.1%;
      height: 70px;
      line-height: 70px;
      text-align: center;
      border-right: 1px solid #181616;
    }
    .wyLayout {
      font-weight: 700;
    }
    .delivery {
      width: 11.1%;
      display: flex;
      flex-direction: column;
      //   border-right: 1px solid #181616;
      .deliveryTop {
        height: 100%;
        line-height: 70px;
        border-right: 1px solid #181616;
        .beakageRate {
          display: flex;
          justify-content: space-between;
          align-items: center;
        }
      }
      .noborder {
        border-right: none !important;
      }
      // .deliveryBottom {
      //   height: 50%;
      //   display: flex;
      //   line-height: 70px;
      //   justify-content: space-around;
      //   border-top: 1px solid #181616;
      //   border-right: 1px solid #181616;
      // }
    }
  }
  .customtr3 {
    width: 100%;
    height: 70px;
    border-bottom: 1px solid #181616;
    border-left: 1px solid #181616;
    border-right: 1px solid #181616;
    // background: #00d9ff;
    display: flex;
    justify-content: space-around;
    .customText {
      width: 11.1%;
      height: 70px;
      line-height: 70px;
      text-align: center;
      border-right: 1px solid #181616;
      .beakageRate {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
    }
    .totalText {
      width: 20%;
    }
    .wyLayout {
      font-weight: 700;
    }
    .completeText {
      width: 11.1%;
      height: 70px;
      line-height: 70px;
      text-align: center;
    }
  }
  .customtr4 {
    width: 100%;
    height: 70px;
    border-bottom: 1px solid #181616;
    border-left: 1px solid #181616;
    border-right: 1px solid #181616;
    background: #75d561;
    display: flex;
    justify-content: space-around;
    ::v-deep .el-input.is-disabled .el-input__inner {
      background: #75d561;
      font-weight: 700;
      color: #ff4800;
      font-size: 18px;
    }
    .customText {
      width: 11.1%;
      height: 70px;
      line-height: 70px;
      text-align: center;
      border-right: 1px solid #181616;
    }
    // .totalText {
    //   width: 11.1%;
    // }
    .bhxsbg {
      background: #f5f7fa;
      border-bottom: 1px solid #181616;
    }
    .wyLayout {
      font-weight: 700;
    }
    .completeText {
      background: #75d561;
      width: 11.1%;
      height: 70px;
      line-height: 70px;
      text-align: center;
      border-bottom: 1px solid #181616;
    }
  }
}
</style>